package StudyCode.summary.myfile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class BitSetByteValue {
	public static void main(String[] argv) {
		byte b = 2;
		System.out.println(setBit(b, 2));
		System.out.println(setBit(b, 1));
	}


	private static byte setBit(byte b, int pos) {
		return (byte) (b | (1 << pos));
	}
}
